// 审批状态 0-初始状态（待审核）； 1-通过；2-驳回; 3-通过待审核；4-通过已驳回  (个人审核：0.待审核，1.通过，2.审核不通过)
const status = {
  0: '待审核',
  1: '通过',
  2: '不通过'
}
const admin = {
  0: '否',
  1: '是'
}
export const userManagement = [
  // 表头定义
  {
    type: 'selection',
    selectable: row => {
      if (row.ifAdmin !== 1) {
        return 1
      } else {
        return 0
      }
    }
  },
  {width: 60, type: 'index', label: '序号'},
  {width: '130px', prop: 'userCode', label: ' 系统编号'},
  {
    'min-width': 120,
    prop: 'loginName',
    label: '用户名',
    'show-overflow-tooltip': true
  },
  {
    'min-width': 120,
    prop: 'userName',
    label: '姓名',
    'show-overflow-tooltip': true
  },
  {
    width: 70,
    prop: 'genderStr',
    label: '性别',
    formatter: row => {
      return row.genderStr === null ? '--' : row.genderStr
    }
  },
  {width: 123, prop: 'phone', label: '手机'},
  {width: 160, prop: 'createdAt', label: '添加时间'},
  {width: 180, prop: 'idCard', label: '身份证号'},
  {width: 180, prop: 'mail', label: '邮箱'},
  {
    width: 120,
    prop: 'ifAdmin',
    label: '是否管理员',
    formatter: row => {
      return admin[row.ifAdmin] || '--'
    }
  },
  {
    width: 120,
    prop: 'auditStatus',
    label: '审核状态',
    formatter: row => {
      return status[row.auditStatus] || '--'
    }
  },
  {
    width: 120,
    prop: 'statusStr',
    label: '用户状态'
  },
  {width: 200, prop: 'btnGroup', label: '操作', fixed: 'right'}
]

export const approveStatus = [
  {lab: '全部', val: ''},
  {lab: '有效', val: 1},
  {lab: '停用', val: 2}
  // {lab: '冻结', val: 3}
]

export const gender = [{lab: '男', val: 1}, {lab: '女', val: 2}]
// 一个用户对应多个组织菜单
export const dialogColumns = [
  {width: 60, type: 'index', label: '序号'},
  {minWidth: '150px', prop: 'orgPositionName', label: '组织-岗位'},
  {minWidth: '120px', prop: 'roleName', label: '角色名称'},
  {width: '110px', prop: 'btnGroup', label: '操作'}
]
